]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellApp: Ensure we set the size of returned texture for window backed apps
authorColin Walters <walters@verbum.org>
Thu, 11 Aug 2011 09:56:00 +0000 (05:56 -0400)
committerColin Walters <walters@verbum.org>
Thu, 11 Aug 2011 09:56:00 +0000 (05:56 -0400)
Unify the two code paths too.

https://bugzilla.gnome.org/show_bug.cgi?id=648149

src/shell-app.c

index 1ff98942980da886fa666bb779825f1a2ab30145..0d20f3a80696d49a6ee3bd9a2ea53cb9a43af801 100644 (file)
@@ -123,6 +123,18 @@ window_backed_app_get_window (ShellApp     *app)
   return app->running_state->windows->data;
 }
 
+static ClutterActor *
+window_backed_app_get_icon (ShellApp *app,
+                            int       size)
+{
+  MetaWindow *window = window_backed_app_get_window (app);
+  ClutterActor *actor = st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
+                                                               G_OBJECT (window),
+                                                               "icon");
+  g_object_set (actor, "width", (float) size, "height", (float) size, NULL);
+  return actor;
+}
+
 /**
  * shell_app_create_icon_texture:
  *
@@ -141,12 +153,7 @@ shell_app_create_icon_texture (ShellApp   *app,
   ret = NULL;
 
   if (app->entry == NULL)
-    {
-      MetaWindow *window = window_backed_app_get_window (app);
-      return st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
-                                                    G_OBJECT (window),
-                                                    "icon");
-    }
+    return window_backed_app_get_icon (app, size);
 
   icon = g_app_info_get_icon (G_APP_INFO (gmenu_tree_entry_get_app_info (app->entry)));
   if (icon != NULL)
@@ -285,13 +292,7 @@ shell_app_get_faded_icon (ShellApp *app, int size)
    * app-tracked from not.
    */
   if (!app->entry)
-    {
-      MetaWindow *window = window_backed_app_get_window (app);
-      return st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
-                                                    G_OBJECT (window),
-                                                    "icon");
-    }
-    
+    return window_backed_app_get_icon (app, size);
 
   cache_key = g_strdup_printf ("faded-icon:%s,size=%d", shell_app_get_id (app), size);
   data.app = app;